import { server } from '../config';

export const login = data => {
    return server({
        method: 'post',
        url: '/user/login',
        data
    });
};
export const addUser = data => {
    return server({
        method: 'post',
        url: '/user/addUser',
        data
    });
};
export const updateUser = data => {
    return server({
        method: 'put',
        url: '/user/updateUser',
        data
    });
};

export const deleteUser = params => {
    return server({
        method: 'delete',
        url: `/user/deleteUser/${params.userId}`
    });
};


export const getPermission = () => {
    return server({
        method: 'get',
        url: '/user/getPermission'
    });
};
export const getUserInfo = params => {
    return server({
        method: 'get',
        url: '/user/getUserInfo',
        params
    });
};

export const getAllUserPermission = params => {
    return server({
        method: 'get',
        url: '/user/getAllUserPermission',
        params
    });
};

export const online = () => {
    return server({
        method: 'get',
        url: '/user/online'
    });
};

export const deleteOnline = params => {
    return server({
        method: 'delete',
        url: `/user/deleteOnline/${params.userId}`
    });
};

export const getVisitor = () => {
    return server({
        method: 'get',
        url: '/user/getVisitor'
    });
};

export const getLoginLogs = () => {
    return server({
        method: 'get',
        url: '/user/getLoginLogs'
    });
};

export const getOPLogs = () => {
    return server({
        method: 'get',
        url: '/user/getSystemLogs'
    });
};


export const deleteLoginLog = params => {
    return server({
        method: 'delete',
        url: `/user/deleteLoginLog`,
        params
    });
};

export const deleteOPLog = params => {
    return server({
        method: 'delete',
        url: `/user/deleteOPLogs${params.systemId}`,

    });
};





